<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>打印预览</title>
		<link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />

	</head>
	<body>
		<p>XX医院压疮风险因素评估及预防措施</p>
		<div id="view"></div>
		<script id="demo" type="text/html">
			<div class="tit">
				<span>姓名:{{ d.data.patName }}</span>
				<span>年龄:{{ d.data.patAge }}</span>
				<span>性别:{{ d.data.patSex }}</span>
				<span>科室:{{ d.data.wardName }}</span>
				<span>床号:{{ d.data.bedCode }}</span>
				<span>住院号:{{ d.data.admid }}</span>
			</div>
			<table border="" cellspacing="" cellpadding="">
				<!-- <tr><th>Header</th></tr> -->
				<tr>
					<td>评估内容</td>
					<td>1分</td>
					<td>2分</td>
					<td>3分</td>
					<td>4分</td>
					<td>结果</td>
				</tr>
				{{#  layui.each(d.data.patientEvaluationRecords.modules[0].items, function(index, items){ }}
				<tr>
				<td>{{items.questionName}}</td>
				
					
				
				</tr>
				{{#  }); }}
				{{#  if(d.data.patientEvaluationRecords.modules[0].items.length === 0){ }}
					无数据
				{{#  } }} 
				
					
						
					
			</table>
			
		</script>
	</body>
	<script src="../js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use(['laypage', 'form', 'element', 'laytpl'], function() {
			var laytpl = layui.laytpl;
			var element = layui.element;
			var laypage = layui.laypage;
			var form = layui.form;



			var param = JSON.stringify({
				"body": {
					"patientId": 100108597,
					"entityId": 4,
					"templateId": 2
				},
				"header": {},
				"token": {}
			});
			$.ajax({
				'type': 'post',
				'url': '/service-nursing/evalution/patientPreview',
				'data': param,
				'dataType': 'json',
				'contentType': "application/json",
				'success': function(data) {
					console.log(data);
					var getTpl = demo.innerHTML,
						view = document.getElementById('view');
					laytpl(getTpl).render(data, function(html) {
						view.innerHTML = html;
					});
				},
				'error': function(res) {
					console.log(res);
				}
			});


		})
	</script>
</html>
